package com.lq.ecoldchain.ui.login

import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.lq.ecoldchain.R
import com.lq.ecoldchain.base.BaseNavigator
import com.lq.ecoldchain.base.view.App
import com.lq.ecoldchain.base.view.BaseFragment
import com.lq.ecoldchain.config.AppConfig
import com.lq.ecoldchain.databinding.FragmentLoginBinding
import com.lq.ecoldchain.model.WeChatModel
import com.lq.ecoldchain.util.log
import com.lq.ecoldchain.util.toast
import com.tencent.mm.opensdk.constants.Build
import com.tencent.mm.opensdk.modelmsg.SendAuth
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import org.kodein.di.Kodein
import org.kodein.di.generic.instance

/*
*2018/12/21 0021  14:16
*function by lq
*/
@Route(path = BaseNavigator.loginFragment)
class LoginFragment: BaseFragment<FragmentLoginBinding>(){
    @Autowired
    @JvmField
    var code:String?=""

    override val kodein: Kodein = Kodein.lazy {
        extend(parentKodein)
        import(loginKodeinModule)
    }

    override val layoutId: Int = R.layout.fragment_login

    override val viewDelegate: LoginViewDelegate by instance()

    override fun initView() {
        binding.delegate = viewDelegate
        if(!code.isNullOrEmpty()){
//            WeChatModel.loginAccessToken(code!!)
        }
    }


}